package com.syaccp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syaccp.mapper.TExchargePackageMapper;
import com.syaccp.model.TExchargePackage;
import com.syaccp.service.TExchargePackageService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hsx
 * @since 2023-07-23
 */
@Service
public class TExchargePackageServiceImpl extends ServiceImpl<TExchargePackageMapper, TExchargePackage> implements TExchargePackageService {


    @Resource
    private TExchargePackageMapper tExchargePackageMapper;


    @Override
    public List<TExchargePackage> TopUpPack(TExchargePackage tExchargePackage) throws SQLException {
        return tExchargePackageMapper.TopUpPack(tExchargePackage);
    }

    @Override
    public int updatePackage() throws SQLException {
        return tExchargePackageMapper.updatePackage();
    }

    @Override
    public int updatePackage2() throws SQLException {
        return tExchargePackageMapper.updatePackage2();
    }
    @Scheduled(cron="0 0 0 * * ?")
    public void UpdateScheduled() throws SQLException {
        int i = tExchargePackageMapper.updatePackage();
        int i1 = tExchargePackageMapper.updatePackage2();
    }

}
